import java.util.Random;
import java.util.Scanner;
import java.util.Random;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 87111
 * Date: 2025-05-13
 * Time: 17:05
 */
public class test {
    public static void main(String[] args) {

    }
    public static void main8(String[] args) {
        //打印X图形
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        for(int i = 0;i < a;i++) {
            for(int j = 0;j < a;j++) {
                if((i == j) || (i + j + 1 == a)){
                    System.out.print("*");
                }else {
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }
    public static void main7(String[] args) {
        //实现猜数字游戏
        Random rd = new Random();
        Scanner sc = new Scanner(System.in);
        int a = rd.nextInt(100);//[0,100)
        while(true){
            //生成随机数
            System.out.println("请输入你猜的数字:");
            int guess = sc.nextInt();
            if(guess > a){
                System.out.println("猜大了");
            }else if(guess < a){
                System.out.println("猜小了");
            }else{
                System.out.println("恭喜你，猜对了!!!");
                break;
            }
        }
    }
    public static void main6(String[] args) {
        //求出0～n之间的所有“水仙花数”并输出。
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int a = i;
            int sum = 0;
            int count = 0;
            //计算几位数
            while(a != 0){
                count++;
                a /= 10;
            }
            a = i;
            //判断水仙花数
            while(a != 0){
                sum += Math.pow(a % 10,count);
                a /= 10;
            }
            if(sum == i){
                System.out.print(i + " ");
            }
        }
    }
    public static void main5(String[] args) {
        //计算1/1-1/2+1/3-1/4+1/5 …… + 1/99 - 1/100 的值
        int i = 1;
        double a = 1;
        double sum = 0;
        while(i <= 100){
            sum += a / i;
            i++;
            a = -a;
        }
        System.out.println(sum);
    }
    public static void main4(String[] args) {
        //求2个整数的最大公约数
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = a % b;
        while(c != 0){
            a = b;
            b = c;
            c = a % b;
        }
        System.out.println(b);
    }
    public static void main3(String[] args) {
        //编写程序数一下 1到 100 的所有整数中出现多少个数字9
        int i = 1;
        int count = 0;
        while(i <= 100){
            if(i % 10 == 9){
                count++;
            }
            if(i / 10 == 9){
                count++;
            }
            i++;
        }
        System.out.println(count);
    }
    public static void main2(String[] args) {
        //输出 1000 - 2000 之间所有的闰年
        for(int i = 1000;i <= 2000;i++){
            if(((i % 4 == 0)&&(i % 100 != 0))||(i % 400 == 0)){
                System.out.print(i + " ");
            }
        }
    }
    public static void main1(String[] args) {
        //打印 1 - 100 之间所有的素数
        for(int i = 1;i <= 100;i++){
            boolean tr = true;
            for(int j = 2;j <= Math.sqrt(i);j++){
                if(i % j == 0){
                    tr = false;
                    break;
                }
            }
            if(tr == true){
                System.out.print(i + " ");
            }
        }
    }
}
